<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__STATIC__/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="__STATIC__/css/public.css" media="all">
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">

        <fieldset class="table-search-fieldset">
            <legend>搜索信息</legend>
            <div style="margin: 10px 10px 10px 10px">
                <form class="layui-form layui-form-pane" action="">
                    <div class="layui-form-item">

                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <select name="modules" lay-verify="required" lay-search="" id ="modules">
                                    <option value="">选择搜索的类型</option>
                                    <option value="job_number">工号</option>
                                    <option value="name">姓名</option>
                                    <option value="job_salary">岗位工资</option>
                                    <option value="retention_benefit_subsidy">保留福利补贴</option>
                                    <option value="job_reward_performance_salary">岗位奖励绩效工资</option>
                                    <option value="basic_performance_award">岗位奖励绩效工资</option>
                                    <option value="special_post_allowance">特殊岗位津贴</option>
                                    <option value="property_subsidy">物业补贴</option>
                                    <option value="civilization_award">文明奖</option>
                                    <option value="one_child_fee">独生子女费</option>
                                    <option value="ethnic_minorities_subsidy">少数民族补贴</option>
                                    <option value="public_sanitation_fee">卫生费</option>
                                    <option value="doctor_subsidy">博士补贴</option>
                                    <option value="professor_subsidy">教授补贴</option>
                                    <option value="rental_subsidy">租房补贴</option>
                                    <option value="car_supplement">车补</option>
                                    <option value="supplementary_salary">补工资</option>
                                    <option value="housing_provident_fund">住房公积金</option>
                                    <option value="medical_insurance_fund">医保金</option>
                                    <option value="endowment_insurance_individual_enterprise">养老保险个人（企业）</option>
                                    <option value="endowment_insurance_individual">养老保险个人</option>
                                    <option value="occupational_annuity_individual">职业年金个人</option>
                                    <option value="deduction_of_individual_income_tax">扣个人所得税</option>
                                    <option value="deduction_of_rent">扣房租</option>
                                    <option value="withholding_property">扣物业</option>
                                    <option value="deduction_of_hydropower">扣水电</option>
                                    <option value="deduction_of_wages">扣工资</option>
                                    <option value="heating_fee">取暖费</option>
                                    <option value="target_assessment_award">目标考核奖</option>
                                    <option value="national_civilized_city_award">职业年金个人</option>
                                    <option value="occupational_annuity_individual">全国文明城市奖</option>
                                    <option value="merit pay">绩效工资</option>
                                    <option value="occupational_annuity_individual">职业年金个人</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <input type="text" name="value" id="value" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <button type="submit" class="layui-btn layui-btn-primary"  lay-submit lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索</button>
                        </div>

                    </div>
                </form>
            </div>
        </fieldset>

        <script type="text/html" id="toolbarDemo">

        </script>

        <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>

        <script type="text/html" id="currentTableBar">
            <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
            
        </script>

    </div>
</div>
<script src="__STATIC__/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
    layui.use(['form', 'table'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table;

        table.render({
            elem: '#currentTableId',
            url: "{:url('index/RealSalary/getrealsalary')}",
            toolbar: '#toolbarDemo',
            defaultToolbar: ['filter', 'exports', 'print', {
                title: '提示',
                layEvent: 'LAYTABLE_TIPS',
                icon: 'layui-icon-tips'
            }],
            cols: [[
                {type: "checkbox", width: 50},
                { field: 'user_id', width: 100, title: '用户ID', sort: true },
                {field: 'job_number', width: 200, title: '工号', sort: true},
                {field: 'name', width: 100, title: '姓名'},
                {field: 'job_salary', width: 200, title: '岗位工资'},
                {field: 'job_level_salary', width: 200, title: '薪级工资'},
                {field: 'retention_benefit_subsidy', width: 200, title: '保留福利补贴'},
                {field: 'job_reward_performance_salary', width: 200, title: '岗位奖励绩效工资'},
                {field: 'basic_performance_award', width: 200, title: '岗位奖励绩效工资'},
                {field: 'special_post_allowance', width: 200, title: '特殊岗位津贴'},
                {field: 'property_subsidy', width: 200, title: '物业补贴'},
                {field: 'civilization_award', width: 200, title: '文明奖'},
                {field: 'one_child_fee', width: 200, title: '独生子女费'},
                {field: 'ethnic_minorities_subsidy', width: 200, title: '少数民族补贴'},
                {field: 'public_sanitation_fee', width: 200, title: '卫生费'},
                {field: 'doctor_subsidy', width: 200, title: '博士补贴'},
                {field: 'professor_subsidy', width: 200, title: '教授补贴'},
                {field: 'rental_subsidy', width: 200, title: '租房补贴'},
                {field: 'car_supplement', width: 200, title: '车补'},
                {field: 'supplementary_salary', width: 200, title: '补工资'},
                {field: 'housing_provident_fund', width: 200, title: '住房公积金'},
                {field: 'medical_insurance_fund', width: 200, title: '医保金'},
                {field: 'endowment_insurance_individual_enterprise', width: 200, title: '养老保险个人（企业）'},
                {field: 'endowment_insurance_individual', width: 200, title: '养老保险个人'},
                {field: 'occupational_annuity_individual', width: 200, title: '职业年金个人'},
                {field: 'deduction_of_individual_income_tax', width: 200, title: '扣个人所得税'},
                {field: 'deduction_of_rent', width: 200, title: '扣房租'},
                {field: 'withholding_property', width: 200, title: '扣物业'},
                {field: 'deduction_of_hydropower', width: 200, title: '扣水电'},
                {field: 'deduction_of_wages', width: 200, title: '扣工资'},
                {field: 'heating_fee', width: 200, title: '取暖费'},
                {field: 'target_assessment_award', width: 200, title: '目标考核奖'},
                {field: 'national_civilized_city_award', width: 200, title: '全国文明城市奖'},
                {field: 'merit_pay', width: 200, title: '绩效工资'},
                {title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center"}
            ]],
            limits: [10, 15, 20, 25, 50, 100],
            limit: 15,
            page: true,
            skin: 'line'
        });

        // 监听搜索操作
        form.on('submit(data-search-btn)', function (data) {
            //执行搜索重载
            table.reload('currentTableId', {
                page: {
                    curr: 1
                }
                , where: {
                    value : $('#value').val(),
                    modules : $('#modules').val()
                }
            }, 'data');

            return false;
        });
        /**
         * toolbar监听事件
         */

        //监听表格复选框选择
        table.on('checkbox(currentTableFilter)', function (obj) {
            console.log(obj)
        });

        table.on('tool(currentTableFilter)', function (obj) {
            var data = obj.data;
            if (obj.event === 'edit') {

                var index = layer.open({
                    title: '编辑窗口',
                    type: 2,
                    shade: 0.2,
                    maxmin:true,
                    shadeClose: true,
                    area: ['100%', '100%'],
                    content: "{:url('index/RealSalary/edit')}?id=" + data.user_id,
                });
                $(window).on("resize", function () {
                    layer.full(index);
                });
                return false;
            } else if (obj.event === 'delete') {
                layer.confirm('真的删除行么', function (index) {
                    obj.del();
                    layer.close(index);
                });
            }
        });

    });
</script>

</body>
</html>